package com.cms.cmsbackend.controller;


import com.cms.cmsbackend.service.ArticleService;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;


public class ArticleController<PageInfo> {
    @Autowired
    private ArticleService articleService;
    @GetMapping("/findByPage")
    @ApiOperation("分页查询")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "page",value = "页码",required = true),
            @ApiImplicitParam(name = "size",value = "页面大小",required = true),
            @ApiImplicitParam(name = "author",value = "条件中的作者",required = false),
            @ApiImplicitParam(name = "title",value = "条件中的标题",required = false)
    })
    public PageInfo findByPage(int page,int size,String author,String title) {

               PageInfo pageInfo=
                       (PageInfo) articleService.selectByPage(page,size,author,title);
        return pageInfo;
    }

}
